﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;
using System.Data.SqlClient;

namespace DAO
{
    public class Customer
    {
        public static DataTable LayDichVu()
        {
            try
            {
                DataTable dt = new DataTable();
                SqlConnection cn = DataProvider.Connect();
                SqlCommand cmd = new SqlCommand("XemDichVu", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                string str = "Exec XemDichVu";

                SqlDataAdapter da = new SqlDataAdapter(str, cn);
                da.Fill(dt);

                return dt;
            }
            catch (Exception)
            { }
            return null;
        }

        public static DataTable LayTyGia()
        {
            try
            {
                DataTable dt = new DataTable();
                SqlConnection cn = DataProvider.Connect();
                SqlCommand cmd = new SqlCommand("XemTyGia", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                string str = "Exec XemTyGia";

                SqlDataAdapter da = new SqlDataAdapter(str, cn);
                da.Fill(dt);

                return dt;
            }
            catch (Exception)
            { }
            return null;
        }

        public static DataTable LayLaiSuat()
        {
            try
            {
                DataTable dt = new DataTable();
                SqlConnection cn = DataProvider.Connect();
                SqlCommand cmd = new SqlCommand("XemLaiSuat", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                string str = "Exec XemLaiSuat";

                SqlDataAdapter da = new SqlDataAdapter(str, cn);
                da.Fill(dt);

                return dt;
            }
            catch (Exception)
            { }
            return null;
        }

        public static DataTable LayATM()
        {
            try
            {
                DataTable dt = new DataTable();
                SqlConnection cn = DataProvider.Connect();
                SqlCommand cmd = new SqlCommand("XemATM", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                string str = "Exec XemATM";

                SqlDataAdapter da = new SqlDataAdapter(str, cn);
                da.Fill(dt);

                return dt;
            }
            catch (Exception)
            { }
            return null;
        }
        public static DataTable LayChiNhanh()
        {
            try
            {
                DataTable dt = new DataTable();
                SqlConnection cn = DataProvider.Connect();
                SqlCommand cmd = new SqlCommand("XemChiNhanh", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                string str = "Exec XemChiNhanh";

                SqlDataAdapter da = new SqlDataAdapter(str, cn);
                da.Fill(dt);

                return dt;
            }
            catch (Exception)
            { }
            return null;
        }
    }
}
